<template>
  <div class="item" :style="{color: (isActive? activeColor : defaultColor)}">
    <div class="content">{{content}}</div>
    <div class="middle">
        <div class="circle" :style="{backgroundColor: (isActive? activeColor : defaultColor)}">{{tampText}}</div>
        <div class="line" :style="{backgroundColor: (isActive? activeColor : defaultColor)}"></div>
    </div>
    <div class="timestamp" v-if="!hideTimestamp">{{timestamp}}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    // 文字
    content: {
      type: String,
    },
    // 时间节点
    timestamp: {
      type: String,
    },
    // 是否隐藏时间节点
    hideTimestamp: {
      type: Boolean,
      default: false
    },
    // 节点内文字
    tampText: {
      type: String,
      default: ''
    },
    // 是否为激活状态
    isActive: {
      type: Boolean,
      default: false
    },
    // 激活状态文字颜色
    activeColor: {
      type: String,
      default: '#409eff'
    },
    // 未激活状态文字颜色
    defaultColor: {
      type: String,
      default: '#ccc'
    },
  },
  mounted() {

  }
};
</script>

<style scoped>
.item {
    display: flex;
    flex-direction: column;
    /* min-width: 100px; */
    width: fit-content;
}
.item .content,.timestamp {
    text-align: left;
    font-size: 14px;
    padding-right: 15px;
}
.item .middle {
    height: 20px;
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
}
.item .middle .circle {
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    color: #fff;
}

.item .middle .line {
    height: 2px;
    width: calc(100% - 20px);
}
</style>